﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;

namespace SmallBasicFun
{
	public static class WindowManager
	{
		public static List<Window> AllWindows = new List<Window>();

		public static Window Current()
		{
						// REVIEW: Llewellyn, I think we should add an active GraphicWindow if one doesn't exist.
						if (!AllWindows.Any())
						{

						}

						return AllWindows.LastOrDefault();
		}

				/// <summary>
				/// Adds Windows to a collection in the context of the currently running program
				/// </summary>
				/// <param name="window">Window to be tracked for life of current program execution</param>
				/// <exception cref="ArgumentNullException">Throw when window argument is null</exception>
		public static void Add(Window window)
		{
						if (window == null)
						{
								throw new ArgumentNullException("window");
						}

			if (!AllWindows.Contains(window))
			{
				AllWindows.Add(window);
			}
		}
	}
}
